<?php

declare(strict_types=1);

namespace app\admin\controller;

use app\admin\model\SysLog as SysLogModel;
use think\facade\View;

class SysLog extends Base
{
    public function index()
    {
        $data = SysLogModel::order('id desc')->paginate(50);

        return View::fetch('index', ['data' => $data]);
    }

    public function delete($id = null)
    {
        if (SysLogModel::destroy($id)) {
            return ['code' => 1, 'msg' => '操作成功'];
        } else {
            return ['code' => 0, 'msg' => '操作失败'];
        }
    }
}
